package tw.twandroidproj.app.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import tw.twandroidproj.app.R;

/**
 * Created by Raymon on 2016/11/6.
 */

public class job_creat_more extends Activity {

    private EditText newjob_more_detail;
    private Button button_save;




    @Override
    public void onCreate(Bundle saveInstancestate){
        super.onCreate(saveInstancestate);
        setContentView(R.layout.job_create_more);

        newjob_more_detail= (EditText) findViewById(R.id.newJob_more_detail);
        button_save= (Button) findViewById(R.id.newJob_more_save);

        button_save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(newjob_more_detail.getText().toString().isEmpty()){
                    Toast.makeText(job_creat_more.this,"您需要写一些东西才能保存",Toast.LENGTH_SHORT).show();
                }
                else{
                    Bundle bundle=new Bundle();
                    bundle.putString("detail",newjob_more_detail.getText().toString());
                    Intent intent =new Intent();
                    intent.setClass(job_creat_more.this,job_create.class);
                    intent.putExtras(bundle);
                    setResult(1,intent);
                    finish();
                }
            }
        });

    }





}
